

// ------------------ 完成数据回填 -------------------------
function renderUser () {
  axios.get('/my/user/userinfo').then(res => {
    // let {username,nickname, emali }=res.data.data
  //  $('input[name=username]').val(username);
  //  $('input[name=nickname]').val(nickname);
  //  $('input[name=emali]').val(emali);
  let form = layui.form;
  form.val('abc',res.data.data);

  });
}
renderUser();

$('form').on('submit',function (e) {
  e.preventDefault();
  let data = $(this).serialize();
  axios.post('/my/user/userinfo',data).then(res=>{
    let {message, status}= res.data;
    if(status ===0){
      layer.msg(message);
      window.parent.getUserInfo();
    }
  })
});

$('button[type=reset]').on('click',function (e) {
  e.preventDefault();
  renderUser();
})
